import request from '@/utils/request'

// 创建市场分类
export function createAffiliationCategory(data) {
  return request({
    url: '/market/affiliation-category/create',
    method: 'post',
    data: data
  })
}

// 更新市场分类
export function updateAffiliationCategory(data) {
  return request({
    url: '/market/affiliation-category/update',
    method: 'put',
    data: data
  })
}

// 删除市场分类
export function deleteAffiliationCategory(id) {
  return request({
    url: '/market/affiliation-category/delete?id=' + id,
    method: 'delete'
  })
}

// 获得市场分类
export function getAffiliationCategory(id) {
  return request({
    url: '/market/affiliation-category/get?id=' + id,
    method: 'get'
  })
}

// 获得市场分类分页
export function getAffiliationCategoryPage(params) {
  return request({
    url: '/market/affiliation-category/page',
    method: 'get',
    params
  })
}
export function getAffiliationCategorylist() {
  return request({
    url: '/market/affiliation-category/list',
    method: 'get',
  })
}
// 导出市场分类 Excel
export function exportAffiliationCategoryExcel(params) {
  return request({
    url: '/market/affiliation-category/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
